Fixes regexps for links and images.