Invagination during the collapse of an inhomogeneous spheroidal shell