Fixed page access error and some small html errors

If page edit filter were used no images could be uploaded by the user
(and some other errors).
Also fixes som html errors like <img> with closing tag or /> that
should not exist.