 <p>Try this:</p> <pre><code>public function show_image() { // this returns "keepcalm.png" $remoteImage = $this-&gt;get_local_link_from_id($this-&gt;imageid); // Set Header header("Content-Type: image/png"); // More info: http://stackoverflow.com/a/2086406/2332336 // Output the contents of image readfile($remoteImage); exit; } </code></pre> <p>If this doesn't work for you, it means PHP is not able to locate the local image <code>keepcalm.png</code> Possibly because it doesn't exist here: <code>http://niederrad.no-ip.org/portal/keepcalm.png</code> (i.e. from the script (<code>image_get.php</code>) execution location <code>http://niederrad.no-ip.org/portal/</code>)</p> <p>If this is the case, you might have to tell your <code>readfile()</code> command where the image is located on your server. By that I mean specify the absolute path to file (on linux server <code>/home/USERNAME/public_html/images/</code> for example)</p> <p>If the image is on a remote server (as your variable name suggests), then your code should look like this:</p> <pre><code> // Output the contents of image exit(file_get_contents('http://remote-site.com/path/to/'. $remoteImage)); </code></pre> <p>Assuming your PHP config has <code>allow_url_fopen</code> set to true.</p>