Rather than addressing the problem in the above code (which should be obvious after reading the error message), you've got a fundamental/conceptual problem that encompasses that error:
//file properties
$file = $_FILES['image']['tmp_name'];
if(!isset($file))
You might as well say if(true) there, because $file is guaranteed to be set every time that if() statement is executed since you defined it on the line right above it. In addition, the line above the if() statement is attempting to access external data without first checking to see that it exists (e.g. using [man]isset/man.
Notice how everything is backwards? Use [man]isset/man to directly test external data - don't attempt to assign that external data to a local variable and then check if that local variable is defined (because you might as well be checking to see if 1 + 1 is equal to 2).