Missing output logic
Wrapped output and save to cache in if-statement, checking if we have icons at all.
Coding standards. Yoda style
Moved output to the loop.