Fix reflow issues with gallery