显示php验证码图像

Having big problems getting my captcha image to display in my html form The "captcaImageOutput.php" file referenced below works perfectly when opened in a browser (code for this also copied below) but I get a broken image in the web form ?

//EDIT - ADDED CODE FOR captchaOutput.php to the end // Greatly appreciate your prompt replies guys!! :)

//CODE FOR HTML FORM
<form action = "captchaOutput.php" method = "POST">
<label for ="verify"><h3>And finally,verify your human!</h3></label>    
<input type = "text" id = "verify" name = "verify" />   
<img src="captchaImageOutput.php" /> 
</form> 

//CODE FOR PHP CAPTCHA IMAGE
<?php
session_start();
$_SESSION['secure']=rand(1000,9999);
?>
<img src = "captchaCode.php" /><br> 

//CODE FOR CAPTCHA GENERATION
 <?php
 session_start();
 header('Content-type: image/jpeg');

 $text = $_SESSION['secure'];
 $font_size = 20;

 $image_width = 110;
 $image_height = 35;

 $image = imagecreate($image_width,$image_height);
 imagecolorallocate($image,255,255,255); 
 $text_color = imagecolorallocate($image,0,0,0); 

for($i=0; $i<30; $i++)
  {   
    $x1 = rand(1,100);
    $y1 = rand(1,100);
    $x2 = rand(1,100);
    $y2 = rand(1,100);
    imageline($image,$x1,$y1,$x2,$y2,$text_color);
    imagesetpixel($image,rand() % $image_width, rand() % $image_height,$text_color);
 }

imagettftext($image,$font_size,0,15,30,$text_color,'font.ttf',$text);
imagejpeg($image);

?>