Я бы
```ruby
<%= image_tag resource.photo.thumb if resource.photo.present? && resource.photo.thumb.present? %>
```