Refactoring of deleteMedia (and now deleting group of items at once)