Singularity Theory and Gravitational Lensing