changed gallery method