NextcloudPi: unhandled exception when updating apps

Well, it seems updating previewgenerator is the problem. You can try to uninstall previewgenerator, update and reinstall previewgenerator with the occ command:

sudo -u www-data php -f /var/www/nextcloud/occ app:remove previewgenerator
sudo -u www-data php -f /var/www/nextcloud/occ app:install previewgenerator