It's certainly possible, see
How can I use a CGI script to return an image?. Mind you, if you are discussion putting this pic into a dynamically generated page, you probably need to make sure that the CGI script handles both the page generation and the image push, and make sure that the image src points back to the script with necessary details in order to push the image out. In other words, if you want to show the mail message and the image, your script will need to be run twice.
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important