It appears that Pillow itself cannot handle HEIC/HEIF, but a plugin can. See GitHub issue for an interesting discussion: Support for HEIF · Issue #2806 · python-pillow/Pillow · GitHub. Beware the licensing dragons and "bat-shit insane" implementation.
Alternatively for a site where we use ImageMagick, we had to add a decode delegate.
# /etc/ImageMagick-6/delegates.xml
# Add this line under the delegates section
<delegate decode="heic" command=""heif-convert" "%i" "%o.jpg" ;/bin/mv "%o.jpg" "%o""/>
For non Safari browsers, to display them directly you need a viewer, like:
The use case is to store the original image but have the scaled down versions in other formats like jpeg? Or you want to just display the image, thus transforming it after upload in a more suitable format?