Changes the filename to reflect the conversion from PDF to JPG.
    This method will preserve the original filename in the meta dictionary.

def change_filename(filehandle, meta):
    """Changes the filename to reflect the conversion from PDF to JPG.
    This method will preserve the original filename in the meta dictionary.
    """
    filename = secure_filename(meta.get('filename', filehandle.filename))
    basename, _ = os.path.splitext(filename)
    meta['original_filename'] = filehandle.filename
    filehandle.filename = filename + '.jpg'
    return filehandle