Misc code cleanup
Image compression for speed optim.