Add image-to-JPEG conversion change image format to jpg everywhere update getimageAR function to handle jpg