Near-infrared images of star forming regions containing masers. Las Campanas observations of 31 southern sources