Write for the canvas.
Use a short top or bottom caption and insert manual line breaks where needed. The text layout wraps and fits captions into their regions. Long captions require smaller type, so review legibility at the size where the image will actually appear rather than only at full resolution.