Put the thumbnails view logic into a partial.