To learn how to change the layout of a gallery, please read Gallery Layout Settings.