 
         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()

      if !scheme
        uri.scheme 'https'

      # Create a hidden clone of the image and load the actual image there. If it loads successfully,
      # hide the placeholder image and show the loaded image, otherwise hide both images.
      img.removeAttr('data-src')
      loaded_img = img.clone().addClass('loading').removeAttr('src').insertAfter(img)
      loaded_img.on 'error', ->
        # If https failed try again with http, and vice versa
        if uri.scheme() == 'https'
          uri.scheme 'http'
        else
