change layout of gallery