improved pages gallery message functionality