Implementing HTML5 galleries