Make the check for an existing icon more robust.