Fixed bugs in the downscaling.
buildMipMapsLevel isn't always called on POT RoI hence we have to scale
it to the nearest enclosing rect first.