Fix a minor bug in the thumbnails helper