Refactoring pixel scaling.
Remove trailing whitespace.
Move the Scale2x code to a separate class.