Escape image source in RegExp test, quote image source in applied background style attribute

This PR allows the use of image URLs containing special characters that would previously cause either the RexExp test to fail or result in an invalid background style attribute being applied, which would then be ignored by the browser.