deletes unnecessary images