A. Again download/create your affected JPEG file.
Done, same error message as I try to upload it. :(
B. Open Teams online app in InPrivate browser mode (use Edge or Chrome browser) and check if you are able to upload it.
Tried Edge Private window, same error with the original or a new image file.

C. For Teams client, check your Teams app is updated with latest version (for this : click on Teams profile picture > click on “Check for updates”, it helps to update Teams with latest version and then follow the below steps and clear Teams cache.
Latest version installed.
Cache clearer.
Same error message. :(
D. If the above suggestion doesn’t help, we need some more time to check this issue and in meantime, we suggest you to use Sniping Tool option to capture screenshot of your JPEG file. Copy that screenshot and use paste option to post your image in Teams channel.
I captured the process on video for you. Error persists. :(
Thank you for your help.