Reject images that are not on the assets domain or a relative path

(Paired with @jamiecobbett on this.)
I don't know, the whole file's only 47 lines. The inner class is somewhere into Premature Indirection territory for me (although it's borderline). It's something I'd definitely consider if this were going to get a lot bigger, but right now it reads perfectly fine to me.