<% if image %> 
  <%= image_tag(image.attachment.url(:product), :itemprop => "image") %>
  <br />
  <%= link_to image_tag('zoom.gif'), image.attachment.url(:original), :class => 'fancybox zoom-image' %>
<% else %>
  <%= product_image(@product, :itemprop => "image") %>
  <br />
  <%= link_to image_tag('zoom.gif'), @product.images.first.attachment.url(:original), :class => 'fancybox zoom-image' %>
<% end %>

<% if image %> 
  <%= image_tag(image.attachment.url(:product), :itemprop => "image") %>
  <br />
  <%= link_to image_tag('zoom.gif'), image.attachment.url(:original), :class => 'fancybox zoom-image' %>
<% else %>
  <%= product_image(@product, :itemprop => "image") %>
  <br />
  <% unless @product.images.empty? %>
    <%= link_to image_tag('zoom.gif'), @product.images.first.attachment.url(:original), :class => 'fancybox zoom-image' %>
  <% end %>
<% end %>

Handle case where images are empty
Handle case where images are empty
