If it's your template file that you're wanting to clean up, open up your template file, and then go to File>Save as Template. There is a dialog box that pops up that allows you to select everything you want to keep or remove. Part of that selection is to unlink all reference files. Then just save it as the same name, or rename it something else if you're not wanting to overwrite your old for some reason.
Not sure if that's what you're looking for or not.