Pinholes have been eliminated in trilayers of YBa2Cu3O7-x(YBCO)/PrGaO3(PGO)/YBCO by introducing 13-nm-thick SrTiO3(STO) films in the intermediate PGO film. The STO continuously covers the bottom YBCO layer and promotes a uniform growth of the subsequent PGO films. The individual PGO films are of high quality up to a thickness of about 40 nm where voids start to appear in the films. The voids disrupt the continuity of the subsequent STO and PGO layers. The technique of introducing thin layers that establish the growth of pinhole-free films can be used for other similar multilayer systems that suffer from pinholes between individual films.