XFB Scaling

Not my branch, but I want comments on this since it fixes bunch of issues
Fixes Cubivore image scaled incorrectly(Issue 7618)
JMC has more things it fixes.