fixes for image scaling