hi,same as you,i also developed the pdftojpg ,it can auto output the "fit to view" jpgs from the pdf
you can see here
https://www.mobileread.com/forums/showthread.php?t=9214
and i think the ghostscript seems not perfect for output jpg, i used the xpdf core