Fix gallery thumbnails selection