\pdfgrid now determines the number of pages of the PDF automatically, so it is no more necessary to specifiy it when using the command.