fixed the gallery problem