 <p>I think from a technical and programming point of view, it would be cool to pass the data image back.</p> <p>You could do that with a base64 encoded version of the image, and most modern browsers will support that. You could also do it with the HTML5 canvas object. <a href="https://developer.mozilla.org/En/HTML/Canvas/Pixel_manipulation_with_canvas" rel="nofollow">Documentation is available on the MDN</a>.</p> <p>However, from a practical point of view, the most maintainable solution is to use an ID and let it make a separate HTTP request. No HTML 5 required, supported in pretty much every browser in use, and you can reuse existing image delivery systems.</p> <p>If your server is tuned, it will be OK to have that extra HTTP request for the image, and it will be much less CPU load on the server if you are doing a lot of these images.</p>