The retry mechanism in `api_call` now encloses both the API call
itself (`client.models.generate_content`) and the subsequent processing
of the response (extraction of text and image data).
This addresses an issue where a 'NoneType' error could occur during
response processing after a technically successful API call, and this
error would not trigger a retry.
The `api_call` function will now attempt the entire sequence (call + process)
up to 3 times with exponential backoff (1s, 2s) if any exception occurs
during this sequence.