changed to support PNG by converting to temp_image file JPG