I think what you mean to say is if the final link has an img then it is not changing the url inside "src" attribute. That is not possible in curl. What you need to do for that is parse the html and the manually change the links so that they are directed from your proxy server.
Also for creating a proxy server, you don't use host. You should fetch the contents using curl and print it out. What you are doing is a redirect and not a proxy
Edit
Sample code for the proxy
<?php
$host = "1.1.1.1"; //This is the host
$url = $host.$_SERVER['REQUEST_URI'];
echo file_get_contents($url);
var_dump($http_response_header); //For debugging
?>
Because you are only making http request i think file_get_contents is a better suited function. Also the var_dump will give you response headers from the "1.1.1.1" ip.
Now a little note here. Have a look at content-type . This is important for images. Because browser needs to know the content type of the response. So what you need to do is parse the http_response_headers and then check for content-type and add headers in your response using header() function accordingly.
Hope this helps you better