Support for single page PDFs

The method used to wait for the first page to finish rendering did not work
when the PDF only had a single page. This commit adds a Bool to track whether
or not the first page has been rendered to avoid looping indefinitely.