To delete the image on the filesystem, the variable you pass to the unlink function has to be a valid filename and apache (or whatever user you webserver runs as) must have appropriate access to delete the file.
If you're storing the binary data of the image in a database, you don't need to delete the file because a file was never created. (Except the tmp file created by php when the file was orignally uploaded, but that was deleted when the script exited.)
If you do actually save the images to files instead of as binary data in a database (something like /var/www/html/ads/$id), a good place to start your troubleshooting would be to make sure the filename you originally saved the image as is the same as the filename you are passing to the unlink function when you try to delete.
Lacey