Refactored image alt text and URL match regexes

See https://meta.discourse.org/t/client-parser-infinite-loops-on-certain-markdown/20460/10?u=elberet