After you create the image, save it to a file on the disk. When you send the results of the page to the browser, make it a regular html page and use the <IMG> tag to reference the image you just created on disk. You will have a cleanup issue if you don't want the dynamic image around after the script runs, but what I usually do is put a cleanup routine in the script so that each time it runs it deletes old images in the directory as well as generating the new ones.
HTH
-- Rich