Near-infrared imaging of H2 in molecular outflows from young stars