But shouldnt if(!$_FILES['photoname']) work.. as its just like checking on post or get for empty fields?

Nope. It's the same as a text field; when it is submitted but there was no text filled in $_POST['myfield'] is still set, but it's set to an empty string. $_FILES['photoname'] is also set, but there is no file in there. Same thing.

Maybe the file you're uploading is too big? Default max size for PHP uploads is 2MB if I remember correctly (plus there is a limit on the web server as well, if that's lower than PHP's limit that's the limit you need to honour).