Fix web view document type setting it only for the main resource

Move document type set after main resource check. Otherwise Epiphany might think
that some pages are images and disable some UI features, when they are actually
regular pages but some images have been loaded a bit later than the HTML.

https://bugzilla.gnome.org/show_bug.cgi?id=722194