Thanks to Stefaan Lippens for this snippet to extract images from a PDF:
Usage is very straightforward:
pdfimages -j foo.pdf bar
This will extract all images from foo.pdf and save them in JPEG format (option -j) to bar-000.jpg, bar-001.jpg, bar-002.jpg, etc.