Some (but not all) JPGs not displaying in Files/Gallery

Expected behaviour

Should be able to view preview of image in owncloud web.

Actual behaviour

Getting the default thumbnail, and image is unable to be previewed.
Page says “Error! Could not generate a preview of this image.”
Console in web browser reports 500 error

Server configuration

Operating system: Ubuntu 22.04

Web server: Apache/2.4.52

Database: 10.6.16-MariaDB-0ubuntu0.22.04.1

PHP version: PHP 7.4.33

ownCloud version: 10.14.0 (stable)

Updated from an older ownCloud or fresh install: Fresh Install

Where did you install ownCloud from: ownCloud site, following ownCloud docs

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

I did this - “No errors have been found.”

The content of config/config.php: I can post parts of this if necessary


**List of activated apps:**
Admin Config Report
Deleted Files
Share Files
Update Notification
Versions
Activity
Collaborative Tags & Management
Diagnostics
Gallery
Market
Notifications
PDF Viewer
Text Editor

Are you using external storage, if yes which one: local

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: firefox/edge

Operating system: win 11

Logs

Web server error log

I coudn’t find relevant logs in the log file, maybe i’m not looking for the right thing