You can easily achieve integration with Get Image โ API Gateway โ Lambda โ S3.
In lambda, instead of json, return the string representation of the base64 image ( buffer.toString('base64') ), make the Gateway API convert the string to binary and add a specific Content-Type (so you don't need limited binary support that forces you to send a specific header Accept).
In the AWS console, go to the Gateway API, then go to the appropriate method and update the settings:
From the command line, run the command below to force the conversion of the string to binary. First, get rest-api-id and resource-id from the API gateway. Then run in the CLI (replace rest-api-id and resource identifier with your own):
aws apigateway put-integration-response --rest-api-id <rest-api-id> --resource-id <resource-id> --http-method GET --status-code 200 --content-handling CONVERT_TO_BINARY
source share