       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
-        image  = $ object
+        #jquery
+        image  = object
         object =
-          source:    image.attr('data-src') or image.parent().attr('href')
-          title:     image.attr('data-title') or image.attr('title')
-          thumbnail: image.attr('src')
+          source:    image.getAttribute('data-src') or image.parentNode.getAttribute('href')
+          title:     image.getAttribute('data-title') or image.getAttribute('title')
+          thumbnail: image.getAttribute 'src'
 
       @_addToGallery object, image
     @


    thumbnails = headerHeight = 0

    if @dimensions.thumbnails isnt false and not @thumbnails.hasClass('choco-hide')
      @dimensions.thumbnails = @thumbnails.height() if @dimensions.thumbnails is 0
      thumbnails = @dimensions.thumbnails

    headerHeight = @dimensions.header if title

                         .replace('{{image}}', image.thumbnail)
                         .replace('{{title}}', if image.title then ' title="' + image.title + '"' else '')

    $(@thumbnails).html(content).find('.choco-thumbnail').each ->
      thumbnail = $ @
      image = thumbnail.attr 'data-image'

