 
       element = new Image()
 
-      element.onload = =>
+      addHandler element, 'load', =>
         if cid is @current
           @images[cid].width  = element.width
           @images[cid].height = element.height

      isElement = if typeof HTMLElement is 'object' then object instanceof HTMLElement else typeof object is 'object' and object.nodeType is 1 and typeof object.nodeName is 'string'

      if isElement
        #jquery
        image  = object
        object =
          source:    image.getAttribute('data-src') or image.parentNode.getAttribute('href')

    thumbnails = headerHeight = 0

    if @dimensions.thumbnails isnt false and not hasClass @thumbnails, 'choco-hide'
      @dimensions.thumbnails = @thumbnails.offsetHeight if @dimensions.thumbnails is 0
      thumbnails = @dimensions.thumbnails

    headerHeight = @dimensions.header if title
