Man,
when i told you my up placed script, i knew that it'll take the page HTML code, not the source, becaus the fopen with the param r means open this file for read, then the server will execute the page, and produce the HTML of it, and then ur script gonna have it to be writen on any other place, so u can use then :
fputs() function to load the HTML produced to a specified HTML page, and i think no need to have the images loaded also, because even when the page will be Executed VIA server, it needs to load the images from server, as well hapen with the new produced HTML page.
dont forget to set the proper permissions for the HTML page u wanna write in ..
good luck ..