Safari (MacOS and iOS) shows wrong image rotation in thumbnails and previews

I noticed that image rotation for thumbnails is correct in Firefox and Chrome, but not in Safari. Are there any workarounds for this? I already tried adding .ril__image { image-orientation: from-image } to custom CSS, but it did not work.

Any ideas? (Seahub-version: 9.0.2, Safari-Version: 15.4)