Merge from gist: cross-browser compatibility, fallback on nophoto url, handle U-prefixed matric numbers