fixed wrong images when using optgroup

When using optgroup the images would be assigned to the wrong element, because of jquery selector. It also calculated the optgroups as key elements for "i".
By using :not() we excluded the optgroup elements.