Hospital settles lawsuit by thousands of women over exam photos