fix(pages): use ElggBatch to avoid memory leaks

Temporary fix for #6477