Exploring the distribution of dark and visible matter with gravitational lensing