"invalid_image" error in gpt-4o when using S3 presigned URL

for me it helped to resize the image first before encoding base64.
see my code example in this post: