Solved the layout horizontal shift when opening gallery