Detecting gravitationally lensed population III galaxies with HST and JWST