Gallery layout fix