Two things... first the validation appears below the database insert code. In order for it to prevent the insert you would have to put the validation below the file upload code and above the insert code.
Second the validated values appear wrong. I think it should be:
<?php
if (isset($_POST["nhSendUpload"]) || isset($_POST["nhSendUpload_x"])) {
$WAFV_Redirect = "";
$_SESSION['WAVT_nhAddPhoto1_202_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateNM(((isset($_FILES["nhImageUpload"]))?$_FILES["nhImageUpload"]["size"]:"") . "",1,50000,"",",.",true,2);
$WAFV_Errors .= WAValidateNM(((isset($_FILES["nhImageUpload"]))?$_FILES["nhImageUpload"]["width"]:"") . "",1,940,"",",.",true,1);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"nhAddPhoto1_202");
}
}
?>