Changed to strrchr in getMimeType() and removed check around realpath of filename