Unable to upload images (Status code: 422422)

I’m trying to create a script to upload images with Python througzh the API, but regardless of what I do, I always get a “Failed to upload image. Status code: 422”. I’d appreciate any help. You can see the script below: