Thats right. You have to ensure that you have appropriate permissions to remove the files.
Try using the boolean function unlink()
Eg: unlink("myimage.jpg");
You could even throw it into an IF statement for error checking purposes as it IS a boolean statement. It will return TRUE if successfully removed and FALSE if it isnt.
Regards
M