How do I automatically shrink flex child's height in `flex-direction: column` so they **all fit in** parent's height?

I tried `flex-shrink` but it didn't help.

Is it even possible?

Thank you in advance!

**Edit**

* Edited the title.
* Children are images, I need to automatically change their height so they fit within parent and cause no overflow.