That's just not going to work.
You're overloading vram, and cpu.
Have you tried the Paster object?
Any suggestions on how to download the base64 string as an image?
I've tried mailto, but it doesn't work on all clients, just as pasting the url into the browser only works on a few.
The Browser object offers to let you download it as a string, but simply setting the mime type doesn't seem to want to convert it back into an image.