Deep Hubble Space Telescope imaging surveys and the formation of spheroidal galaxies