   def update(conn, %{"id" => id, "napkin" => napkin_params, "napkin_image" => image}) do
     case load_napkin(conn, id) do
       {:ok, napkin} ->
-        update_image(napkin, image, napkin.token)
+        update_image(napkin, image)
         update_params = Map.take(napkin_params, [
           "json", "repository_full_name", "issue_title", "issue_description"
         ])

  defp save_image(base64_image, token) do
    normalized = base64_image |> String.split(",") |> List.last
    {:ok, image_data} = Base.decode64(normalized)
    host = Application.get_env(:beer_napkin, :s3_host)
    bucket = Application.get_env(:beer_napkin, :s3_bucket)
    BeerNapkin.S3.save_png("#{token}.png", image_data)
  end

  defp update_image(napkin, base64_image, key) do
    normalized = base64_image |> String.split(",") |> List.last
    {:ok, image_data} = Base.decode64(normalized)
    BeerNapkin.S3.update_png(napkin.image_key, image_data)

  use BeerNapkin.Web, :controller
  plug :authenticate
  alias BeerNapkin.Napkin

  def new(conn, _params) do
    changeset = Napkin.changeset(%Napkin{})
