The image layer sets the size
The text layer sets the size
No layer here has a height of its own. The text is the largest, so the stack is as tall as the text, and the gray layer behind stretches to fill it.