Fixed an issue with destroy.

Check if the obj variable has a method called 'destroy' before calling it.
Without this, I kept getting an error saying:
http://site.com/img/image.jpg has no method 'destroy'.