Default empty $pages to range array

This removes some code duplication and imho makes the code somewhat more readable.
Merge pull request #2 from md2perpe/patch-1

Default empty $pages to range array