modify gallery layout