added GALLERY_DIR auto detect