This gives us a better chance of finding an icon to show. Closes: #1809 (cherry picked from commit fbe0e328)