File upload and file extensions .jpg .jpeg

Looking for a little advice, I have a file upload form, that saves to a folder.
As a secondary step it creates a smaller thumbnail image too with a Load Image, Resize Image, Save Image
My Upload Step is set with a Template of {name}{ext} and my Save Image step has a Format Auto and a Template of {name}{ext} the same as the upload step.

When I upload .jpg, .png, .gif files everything is fine and the filename of the main image and the thumbnail image are identical.
If I however upload a .jpeg file, the main file remains .jpeg while the thumbnail is .jpg and drops the e from the extension.

I have tried adding an expression to the File Upload Template, however I must have the wrong syntax because I can not get it to work. This is what I tried

{name}{ext}.replace('jpeg', 'jpg')

And about 20 other variants of that with curly braces, parenthesise, additions, ternary versions, and it seems I can not find the perfect fit.

Any Ideas?

Community Page
Last updated: