check to gd graphics library:
in terminal: php -i | grep -i gd
if it has been installed you should see that message:
GD Support => enabled
if it is not installed you need to install it manually according to php version.
example: sudo apt-get install php7.3-gd