JPEG corrupt data

Nextcloud version : 22.1.1
Operating system and version : Linux 5.10.52-v7l+ armv7l (raspbian-lite)
Apache version : Apache/2.4.38 (Raspbian)
PHP version : 7.3.29

The issue you are facing:
Hello, I recently installed nextcloud on my raspberry pi. I fixed some major issues, but I have jpeg corrupted data for some reason when I upload a folder with images. Here is an example how I see the image after I upload it to my nextcloud. The original photo is completely fine. Screenshot 2021-09-05 124946

The output of your Nextcloud log in Admin > Logging:

https://pastebin.com/LPyGPyWW

Config.php file in /var/www/nextcloud/config/config.php

<?php
$CONFIG = array (
  'instanceid' => 'ocv8fx7e3lpy',
  'passwordsalt' => '...',
  'secret' => '...',
  'trusted_domains' =>
  array (
    0 => '192.168.1.11',
    1 => '...',
  ),
  'datadirectory' => '/var/www/nextcloud/',
  'dbtype' => 'mysql',
  'version' => '22.1.1.2',
  'overwrite.cli.url' => 'https://192.168.1.11/nextcloud',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'johnnext',
  'dbpassword' => '...',
  'installed' => true,
  'default_phone_region' => 'GR',
  'maintenance' => false,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
);