setting galleryPresent variable