* fix: always set extension from provided file
The livephoto case can also happen with other files; for example, we
receive a DNG file as JPEG but then still call it .dng
Fixes#29805, partially addresses #28602
* chore: test cases for file extension naming