Fixed Media deletion

Delete the Media file after the entity removal, in case of DB exception.