title: GD2 URL showing as an image
body: <p>When I run this code I get the following error:</p>
  
  <p>The image "<a href="http://siteprevue.net/flipit.php" rel="nofollow">http://siteprevue.net/flipit.php</a>" cannot be displayed because it contains errors.</p>
  
  <p>I'm thinking... of course it can't be displayed, it's a url not an image... duh?!</p>
  
  <p>Everything executes fine, I just get this black page that thinks the url is an image.</p>
  
  <p>This happens on (some) other GD2 coded pages as well, but not all.</p>
  
  <p>Does anyone have any idea what's happening?</p>
  
  <pre><code>&lt;?php
  $src = '../../Uploads/Gallery/drafting_site_bg_200.jpg';
  $new_img = '../../Uploads/Gallery/copy_bg_200.jpg';
  
  $image = imagecreatefromjpeg($src);
  $image = flip($image,1,0); // flips horizontal
  //$image = flip($image,0,1); // flips vertical
  //$image = flip($image,1,1); // flips both
  
  header("Content-type: image/jpeg");
  imagejpeg($image, $new_img, 80);
  imagedestroy($image);
  
  function flip($i,$h=1,$v=0) {
  $width = imagesx($i);
  $height = imagesy($i);
  $temp = imagecreatetruecolor($width,$height);
  imagecopy($temp,$i,0,0,0,0,$width,$height);
  if ($h==1) {
  for ($x=0 ; $x&lt;$width ; $x++) {
  imagecopy($i, $temp, $width-$x-1, 0, $x, 0, 1, $height);
  }
  imagecopy($temp,$i,0,0,0,0,$width,$height);
  }
  if($v==1) {
  for ($x=0; $x&lt;$height ; $x++) {
  imagecopy($i, $temp, 0, $height-$x-1, 0, $x, $width, 1);
  }
  }
  return $i;
  }
  
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org   /TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>