only link to the gallery if there are images to show
more image optimization