Logic For Merging TIles

1.Only at a particular zoom level can i see both set of tiles , if i zoom out i cannot see like in image 2. The reason is I currently run gdal2tiles on a new folder of images and uses rsync to merge the original folder containing tiles with the folder containing new set of tiles. While the logic works for higher zoom levels, it fails on lower zoom levels due to the same file structure existing in both the folders.

WHat would be the apt way to merge 2 folder containing tiles?

Some aspects are not entirely clear for me (i.e. the input data and where ‘rsync’ comes into play). But from the description, it sounds like you may want to have a look at the 3D Tiles Tools merge functionality. (Optionally followed by a combine)