To convert pdf to image files use following commands:
For PNG gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -o a.png a.pdf
For JPG gs -sDEVICE=jpeg -dTextAlphaBits=4 -r300 -o a.jpg a.pdf
If you have multiple pages add to name %03d gs -o a%03d.jpg a.pdf