Imrpoved get_available_pages performance

Replaced code that generated multiple 8 byte reads throughout 2 nested for cycles for 1 + 512 (eventually) 4k reads. Previous code could result in as much as 262,656 8 bytes read (each with an unnecesary seek).