readjust gallery layout