convert file to jpg
to_jpg: if no dest given, just attach .jpg
automatically replace .png with .jpg