I believe this is what you are looking for:
https://codepen.io/StevenStavrakis/pen/XWoeGXE
It's not the prettiest solution, but it definitely works.
You can read more from this thread:
To roughly describe:
We create our image section
We create a spacer element
We make our scrolltrigger such that it scrubs for twice as many pixels as our viewport is tall
We make our animation so that half of it is the image scaling and the other half does nothing
We set pinSpacing to false
When we start scrolling:
The image section pins at the top and loses all its height because we didn't put a pin spacer
We scroll 100vh, during which our image grows, and our spacer gets moved up the page
After the spacer has completely scrolled, we will be halfway through our scrub, and therefore halfway through our animation
The second half of the animation is empty, so the section remains pinned as our text comes into view
Once the text section is completely within view, we reach 200% of our image section and the pin releases
I think this should be the solution you are looking for. @Rodrigo and @Cassie came up with solutions for the original thread, so either might be able to provide more input. I think it would be interesting if instead of making a spacer element we could customize the pin-spacer, but that's not currently possible as I understand.