[SPRINTFIX][#56746980] Cast the results of the request to an array before taking a count when getting all pages of an index

This is the webapp merge for #52.