Added new pagination html.
Update to more modern hadling of view, text processing and gallery rendering.