Catch invalid URI exceptions to support http://:0 URLs

For img tags, since some browsers block if you leave the src attributes
empty, the current technique is to use //:0 as the URL. This causes
puffing billy to fail, even when these requests are stubbed, since the
URI library throws an exception. This statement has a fallback of empty
string anyway, so catch exceptions and use the fallback.