Make gallery design

Hello, friends, I want to make this gallery design, but I want to make it automatic, I put a list of images and it is automatically generated according to the size of the images that I enter. Can it be done and how could it be done?

Thanks in advance.