Then the caller of the method should test for the returned null value to know that the panel is filled.

Not sure about this design.
Should the method define and fill a panel with images and...