         for product_image, i in product_images
             product_gallery_data =
                 index: i
-                classes: "product-thumbnail #{(if i is 0 then 'on' else 'hide')}"
+                class: "product-thumbnail #{(if i is 0 then 'on' else null)}"
                 product_name: gon.product_name
                 product_image: product_image
 


            fetch_product_images($('.product'), render_multiple_product_images)

            ($ '.product-thumbnail-gallery')
                .on('swipeLeft', (e) ->
                    $this = ($ e.target)
                    next_index = $this.next().data('index')
                    if next_index?
                        $this.addClass('hide')
                        $this.next().removeClass('hide')
                        ($ '.product-gallery-control.on')
                            .removeClass('on').next().addClass('on'))
                .on('swipeRight', (e) ->
                    $this = ($ e.target)
                    previous_index = $this.prev().data('index')
                    if previous_index?
                        $this.addClass('hide')
                        $this.prev().removeClass('hide')
                        ($ '.product-gallery-control.on')
                            .removeClass('on').prev().addClass('on'))

            # setTimeout is required because
            # tap was clicking the purchase

                classes: "product-gallery-control #{(if i is 0 then 'on' else '')}"
                index: i


            if product_images.length > 1
                $product_gallery_controls_wrapper.append Mustache.render(
                    templates.product_thumbnail_gallery_control_template, product_gallery_control_data)

        $self.find('.product-thumbnail-gallery')
            .html($product_gallery_wrapper)
