In brief
The sculptures and frescoes are connected with separate rock spaces.
Useful to know
The Mogao Caves in China are Buddhist shrines along historic trade routes. UNESCO describes numerous rock rooms with sculptures and murals created over a long period. [1]
This is a different architectural logic than a free-standing temple with one large facade. Important are the separate cave, the access and the connection between the space and the images. When comparing photographs, check which room and period they are from. The similar religious theme does not mean the same date or one author's project for the whole ensemble.
Sources
For further detail and to check the information: