added multiple gallery support