I believe the problem is not with the delete, but with the update after a delete.
When you delete the call to directory.php returns "Access Denied", it should refresh the resource browser and remove the deleted image. Error is thrown when u try and delete the already deleted image!
I would imagine the undefined in the url is because the image no longer exists...
I plan to look at this over the next week or so, other stuff on the pile first tho

I too was hoping someone would get to it first!