The morphologies of distant galaxies. II. Classifications from the Hubble Space Telescope medium deep survey