This code would be simpler if the thumbnails were directly contained by the group.