added code to delete_resource function to ensure that alternative
previes are deleted at the same time as their associated files.
this should take care of issue #63, but I think there may be
other contexts (such as overall resource deletion) that may delete
alternatives without using this function. We should look out for this
going forward.