Address RegEx Performance

RegEx performance of match can cause issues on some browsers for some images; replace with substring.