fallback to imprecise scaling if low memory

Gracefully falls back to rough scaling to solve the OutOfMemoryErrors that I was able to reproduce on a GB emulator with low RAM. This helps a lot since it doesn't require two large Bitmap objects in memory at the same time.

Also moved away from BufferedInputStream to another workaround to the Android bitmap problems, which will save more memory. On top of that, we weren't closing the streams so that's also fixed.