I think the problem is your file path argument in is_file and unlink. If you can change directory to where the file is located before call is_file or unlink, it would be easier. After that, you can use only filename like is_file('test2.png').
<?php
$old = getcwd(); // Save the current directory
chdir($path_to_file);
unlink($filename);
chdir($old); // Restore the old working directory
?>
(source: http://au1.php.net/chdir)