Minor fixes to image scaling