if upscale an ICC based image, first transform with lcms and then upscale (old behaviour), if downscale then first downscale and then transform with lcms.
This is an alternate patch to !1290. It keeps the optimization of commit 3db4cb6f, but in case of zoom in okular or render a icc based image with a high resolution, it falls back into the old implementation before commit 3db4cb6f