<% r = image.children.order(:updated_at).where('type = ?', 'UploadedFile').last(3) %>
<% if r.length > 0 %>
<% r.each_index do |i| img = r[i] %>
<%= link_to '', img.view_url, :class => "search-image-pic pic-num#{i+1}",
:style => 'background-image: url(%s)'% img.public_filename(:thumb) %>
<% end %>
<% else %>
<%= _('No image') %>
<% end %>
<% else %>