better handling of image centering