When using this library with PDFs, the term "image" applies to a page where the pointer begins at the last page of the document.
<?php
$document = new Imagick('myPdf.pdf'); //2 page PDF
$document->getNumberImages(); //returns 2
var_dump($document->hasNextImage()); //returns false - remember, we're on the last page
var_dump($document->hasPreviousImage()); //returns true
?>
If you need to do more than generate thumbnails from a PDF, use XPDF: http://www.foolabs.com/xpdf/home.html