Looking through the 1891 and 1901 censuses I think the Shepherd names are just co-incidence; a pity.
These are the most likely entries for your John William, but you will need to buy the 1913 marriage certificate to confirm them:
1891 RG12/1341 East Ham
William Shepherd, 28, gas fitter, b Louth, Lincs
Mary A S, 22, wife, b Barking
George S, 2, son, b Barking
John William S, 4m, son,b New Beckton
1901 RG13/1606 East Ham
William Shephard, 39, coal porter, b Lincs
Mary A S, 30, wife, b E Ham
George S, 12, son, b Barking
John S, 10, b E Ham
William S, 3, son, b E Ham
Richard