<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def convert(self, image, output=None):
 """ Convert an image to a PDF. :param image: Image file path :param output: Output name, same as image name with .pdf extension by default :return: PDF file path """

        return self._convert(image, image.replace(Path(image).suffix, '.pdf') if not output else output)