%# no need for thumbnails unless there is more than one image %>
<% if (@product.images + @product.variant_images).uniq.size > 1 %>
<% @product.images.each do |i| %>
-
<% img_tag = image_tag(main_app.url_for(i.url(:mini)), class: "thumbnail", alt: set_image_alt(i, :mini)) %>
<%= link_to(img_tag, main_app.url_for(i.url(:product))) %>
<% end %>
<% if @product.has_variants? %>
<% @product.variant_images.each do |i| %>
<% next if @product.images.include?(i) %>
-
<% img_tag = image_tag(main_app.url_for(i.url(:mini)), class: "thumbnail", alt: set_image_alt(i, :mini)) %>
<%= link_to(img_tag, main_app.url_for(i.url(:product))) %>
<% end %>
<% end %>
<% end %>