Fixed bug in upload code that was executing creation of input stream twice
Reworked bitmap scaling code to be more accurate and useful