I have several images and I must put their names below them. Moreover, I need to give the name of the group of that images too (for example, "first layer", "second layer" ect as show below). I need to have something as shown in the figure below.
IMPORTANT: In my case, a group of images may contain more than one row. I mean, the "(a) first layer" may contain more than 3 images and hence can be a group of images in more than one row.


