Fix image downscaling, and a few style tweaks. Fix #157