How do I use a numerical variable and a loop in automator?
Intheory, s.o. could copy this or clone this file, name it document.wflow and put it inside a folder structure like this /pdfToJpeg.workflow/Contents/document.wflow and open it in Automator. 

This is the structure of a .workflow file when you look at Package Content.

This workflow will ask for a file to select, extract any page as pdf, rename each file like page_01.jpg and convert it from pdf to jpg. 

Please be patient, its Automator, but you can invoke it step by step from Automator.app.

This is how workflow looks like: