Address RegEx Performance

RegEx performance of match can cause issues on some browsers for some images; replace with substring.
Merge https://github.com/mrsean2k/angularjs-imageupload-directive