Added ability to output a JSON file containing a base64 string of the image