delete the images imagejpeg creates
<p>Is it possible to delete the images that <code>imagejpeg</code> creates I have the images uploading to my Amazon S3 server but the files just pop up in the main directory on my server after its ran. </p>

<pre><code>    $new_height = 120;
    $width = imagesx($originalImage);
    $height = imagesy($originalImage);
    $new_width = round(($width * $new_height) / $height);
    $imageResized = imagecreatetruecolor($new_width, $new_height);
    imagecopyresampled($imageResized, $originalImage, 0, 0, 0, 0, $new_width, $new_height, $width, $height);

    $tmp_loc = 'uploads/thumb/';
    $tempfilename = tempnam($tmp_loc, $filename);
    imagejpeg($imageResized, $filename,100);
    imagedestroy($imageResized);
    imagedestroy($originalImage);
    unlink($tempfilename);
</code></pre>

<p>I tried <code>imagedestroy</code> and  <code>unlink($tempfilename);</code> but the file remains.</p>
