pass the document counter as part of rendering the gallery thumbnail