Only remove icons relating to the current element

The current code will remove other instances of the icon if it appears more than once on the page.