Of course it CAN be done! It WILL validate, but the w3c.org is just showing you an example. NOT coding semantically. SEs would expect to read something between the heading tags other than an image.
I code to XHTML strict and HTML 5, but I do it semantically as well as syntactically.
Just because something CAN be done, doesn't mean it should be. Put your images between your head tags if you want. Just because the Validator likes it, still doesn't mean it SHOULD be ok that way. Other factors come into play at times.