oh..hmm ! If the user has uploaded the images, there will be an entry for every uploaded images in the database. (ie., the path of the 5 images.) Get all the records for that particular user and then delete them. for example, if the user with userid 3 has uploaded 5 images. There will be 5 entries in the table image_upload(which contains the path of the images).
$q="select * from image_upload where userid='5'";
$result=mysql_query($q); //the query returns 5 records
while($row=mysql_fetch_array($result)){
$imagepath=$row['path']; //$imagepath will have the path of the uploaded image.
unlink($imagepath);//delete the file
//then delete the directory. I hope you are saving the images into the directory which is named after userid.
}
rmdir(5); //remove the directory with userid 5.
?>