Rewrite the scaled image caching code in LxImage::ImageView to improve its readability and correctness.