Changing line 84 of :
flarum\vendor\flarum\core\src\Core\Command\UploadAvatarHandler.php
from
$tmpFile = tempnam($this->app->storagePath().'/tmp', 'avatar');
to
$tmpFile = tempnam($this->app->storagePath().'/jpg', 'avatar');
should do the trick for jpg files, but doesn't... Temporary file has still the tmp extension. Perhaps this file is not used directly ?
But it is only a dirty workaround. Extension should be changed to the source file extension.
Sorry if I don't have time to investigate