allows jpgjs to deal with datauri images

without running into CORS restrictions
nit: make else on the same line: `} else {`