Fixed parts of the image gallery functionality