gallery layout fix