Try using either Mozilla or Firefox with the Live HTTP Headers plugin to work out what your browser is asking for. When you load the page, the HTTP requests for all resources on the page will be recorded by the Live Headers plugin.
In general you should:
- Check that your script is creating the correct HTML for the img tag.
- Take the img source and us it with the page URL to investigate whether there is a problem server side.
- Use Live Headers to investigate the transaction looking for things that are not related to the HTML such as cookies etc.
My bet is that the source of your image tag refers to a resource that isn't there. E.g. your script is running as http://localhost/cgi-bin/myscript.cgi and the browser is creating the URL http://localhost/cgi-bin/htdocs/test/DailyReport.jpg for your image. I reckon that this isn't what you want.