Made scaling resize algorithm more intuitive. Also fixed rounding issue.