Put the siblings from to to - 1 under parent into a gallery, when every one of them is an image or a captioned figure.
from
to - 1
parent
Put the siblings
fromtoto - 1underparentinto a gallery, when every one of them is an image or a captioned figure.