implementing toBuffer
toBuffer is working. need to make it more robust.

also: went back to jpeglib and deleted jpeg-compressor