fixing image layouts in certain situations