Check file width PLEASE! :)

Hi im trying to check the width of a file being upload to the file i then want it to display the error if its more than 150px but i cant get it to work, PLEASE PLEASE can some one help me with it. heres the code so far:

(list($width) = getimagesize($HTTP_POST_FILES['img1']));
     if ($width < 151 AND !isset($error));{
$error = "$width<b>Error: File must be 150x150px or below. </b><br><br>";
unlink($HTTP_POST_FILES['img1']['tmp_name']);    

}