My image will not show when i try shrink it to show within a window
<?php
$filename = "../item-img/" . $_GET['file'];
// Content type
header('Content-Type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$percent = 0.99;
do {
$percent = $percent - 0.01;
$newwidth = $width * $percent;
$newheight = $height * $percent;
} while ($newwidth > 267 && $newheight > 200);
// Load
$thumb = imagecreatetruecolor(267, 200);
$white = imagecolorallocate($thumb, 255, 255, 255);
imagefill($thumb, 0, 0, $white);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb);