Added check for page-agallery-active setting in generatePageHome