 
         loaded_img.off 'error load'
         loaded_img.on 'error', ->
-          img.addClass 'hidden'
+          hide_placeholder_image img
         .on 'load', ->
           show_loaded_image img, loaded_img
         loaded_img.attr 'src', uri.toString()

  # - entry to which the image belongs
  #--------------------------------------------
  load_image = (img, entry=null)->
    # Create a clone of the image, hide it and load the actual image there. If it loads successfully,
    # hide the placeholder image and show the loaded image, otherwise hide both images.
    data_src = img.attr 'data-src'

    if !data_src || data_src?.trim()?.length == 0
      # If data-src is blank, just hide the spinner
      img.addClass 'hidden'
    else
      # If data-src is not blank, lazy-load the image
      uri = new URI(data_src).normalize()

  # - jQuery object wrapping the loaded img
  #--------------------------------------------
  show_loaded_image = (placeholder_img, loaded_img) ->
    hide_placeholder_image placeholder_img
    animationsSvc.show_image loaded_img

  #--------------------------------------------
  # PRIVATE FUNCTION: Hide the spinning placeholder of a loading image.
  # Receives as argument:
  # - jQuery object wrapping the placeholder img
  #--------------------------------------------
  hide_placeholder_image = (img) ->
    img.addClass 'hidden'

  service =

