       $lightbox.find('.lb-number')
         .html( @options.labelImage + ' ' + (@currentImageIndex + 1) + ' ' + @options.labelOf + '  ' + @album.length)
         .fadeIn('fast')
-    else
+    else 
       $lightbox.find('.lb-number').hide()
 
     $lightbox.find('.lb-outerContainer').removeClass 'animating'
-
+    
     $lightbox.find('.lb-dataContainer')
       .fadeIn @resizeDuration, () =>
         @sizeOverlay()
     return
-
-
-  # Preload previos and next images in set.
+    
+    
+  # Preload previos and next images in set.  
   preloadNeighboringImages: ->
-    if @album.length > @currentImageIndex + 1
+   if @album.length > @currentImageIndex + 1
       preloadNext = new Image
       preloadNext.src = @album[@currentImageIndex + 1].link
 
     if @currentImageIndex > 0
       preloadPrev = new Image
-      preloadPrev.src = @album[@currentImageIndex - 1].link
+      preloadPrev.src = @album[@currentImageIndex - 1].link    
     return
 
 

      @end()
    else if key == 'p' || keycode == KEYCODE_LEFTARROW
      if @currentImageIndex != 0
        @changeImage @currentImageIndex - 1
    else if key == 'n' || keycode == KEYCODE_RIGHTARROW
      if @currentImageIndex != @album.length - 1
        @changeImage @currentImageIndex + 1
    return


  # Closing time. :-(
  end: ->
    @disableKeyboardNav()

      .css
        top: top + 'px'
        left: left + 'px'
      .fadeIn( @options.fadeDuration)
      
    @changeImage(imageNumber)
    return
  

  # Hide most UI elements in preparation for the animated resizing of the lightbox.
  changeImage: (imageNumber) ->
    
    @disableKeyboardNav()    
    $lightbox = $('#lightbox')
    $image = $lightbox.find('.lb-image')

    @sizeOverlay()
    $('#lightboxOverlay').fadeIn( @options.fadeDuration )
    
    $('.loader').fadeIn 'slow'
    $lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide()

    $lightbox.find('.lb-outerContainer').addClass 'animating'
    
    # When image to show is preloaded, we send the width and height to sizeContainer()
    preloader = new Image
    preloader.onload = () =>
      $image.attr 'src', @album[imageNumber].link
      
      # set image size limit
      innerWidth  = window.innerWidth  || document.documentElement.clientWidth
      innerHeight = window.innerHeight || document.documentElement.clientHeight
