Maybe you can start by describing what you have.

I assume you images are not on disk or anywhere else that is referencable by URL, right?

How does your application generate them and where/how to you store them in memory?

Cheers,
_