       idx += 4
     false
 
-  image_abort_event: (e) ->
+  image_abort_event: (e) =>
     @completed
       success: false
       aborted: true
     return
 
   # This happens on normal errors, usually because the file isn't a supported image.
-  image_error_event: (e) ->
+  image_error_event: (e) =>
     @completed success: false
     return
 

    e.stop()
    if @similar
      @similar.destroy()
    @similar = new ThumbnailUserImage(file, @complete.bind(this))
    return

  # Submit a post/similar request using the image currently in the canvas.
  complete: (result) ->
    if result.chromeFailure
      notice 'The image failed to load; submitting normally...'
      @force_file = @file


  # When the image finishes loading after form_submit_event sets it, update the canvas
  # thumbnail from it.
  image_load_event: (e) =>
    # Reduce the image size to thumbnail resolution.
    width = @image.width
    height = @image.height
