This may or may not work, its just theory.
In the days of asp, include files were processed along with the asp itself so you could provide functionality inside of your includes, so here is the theory:
In .NET i can use an aspx page as an image src like <img src="page.aspx?id=1"> on page.aspx i would do a Request.Querystring("ID") then setup my GDI functionality, create the image, and use a binary writer to send the datastream back to the browser effectively displaying the image.
So, I don't know if this is possible or not, but on your include you could try: file.aspx?page=page and then on the file.aspx page do a request.querystring and based off of what the value of page is select the image to display. Again, this is only a theory and I don't actually know if it will work, but try it out!
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature