This is caused by the GD library either not being correctly installed or updated in Apache hosts. Reinstall or make sure GD libraries are enabled and working properly. Otherwise this is the exact problem you’ll get. If you don’t host your own WordPress, ask your host to investigate why GD isn’t working properly on your server.