Script to convert PDF to JPEG using Ghostscript library