/**
  * Generate an in icon based on an on-wiki file or a canned CK icon
  * @param $icon string icon id, filename, or random seed
  * @param $size int intended height/width for rendered icon in px
  * @param $fallback string what to do for no icon; allowed values are 'random', 'none', or a valid icon id
  * @return string html
  */
 public static function makeIconOrImage($icon, $size = 50, $colour = 'black', $fallback = 'random')
 {
     // We were going to only find files with file name extensions, but that's hard to parse, and there's no way to really handle ones that aren't uploaded, so we'll just look and see if they're uploaded and be done with it.
     if (wfFindFile($icon)) {
         // TODO also find if prefixed with 'file:', 'image:', etc
         return CollaborationKitIcon::makeImage($icon, $size);
     } elseif ($fallback == 'none') {
         return '';
     } else {
         // canned icons time
         $iconsPreset = CollaborationKitIcon::getCannedIcons();
         if (!in_array($icon, $iconsPreset) && in_array($fallback, $iconsPreset)) {
             return CollaborationKitIcon::makeIcon($fallback, $size, 'grey2', '#eee');
         } else {
             // makeicon falls back to making a random icon anyway, and we've ruled out all the other fallbacks at this point
             return CollaborationKitIcon::makeIcon($icon, $size, $colour);
         }
     }
 }