Tweaked jpeg-js library encoder to allow for RGB image data (rather than assuming RGBA)