Refined the image gallery rendering