Last night I tried making a little test page that had a bunch of <img> elements and nothing else. It didn't work. Fix this by correctly adding a synthesized <html> element to the document if we get something else in the "before html insertion mode.