Improved gviewer handling of page ranges

The generated image files are now correctly named matching the pages rather than being renumbered from 1.