I would be very cautious analyzing medical images that have been converted to JPG format. 3 concerns jump immediately to mind. First, JPEG only support 8-bit precision, whereas modern scanners use 16-bit ADC. A large fMRI signal may be only a fraction of this range (e.g. 1-2%), so downsampling the data is a concern. For CT scans (where intensity is calibrated), you could select a specific window center and width (brightness and contrast) to just select soft tissue. However, most image intensity is relative for most MRI sequences and homogeneity issues make it hard to select a global downsampling. A second issue with JPEG is that it is inherently lossy, with blocking artifacts and compression tricks that are intentionally designed to be hard for the human eye to spot. A third issue is that MRI scans have a lot of information that can be leveraged by retaining 3D spatial information that can be lost when only looking at 2D slices. I understand that a lot of neural networks have been tuned for JPEG, as this is a common format on the web for sharing photographs. However, I do think it is worth preserving the richness of your dataset if you want to have the best performance for machine learning.