OCRmyPDF.sh: computation of resolution

Added compuation of resolution of each PDF page
Added extract of image of pgm if colorspace is Gray (to speed up
computation and save space)