nicer html5 support

switched to new html5 caption and gallery support and added nicer
backwards compat handling