Removes images which are not in use.