Added processContent to generatePageGallery