I am co-Administrator of a private FaceBook group of former students who attended my high school. I frequently take photos with my camera of photos printed in our high school yearbooks & post them in the group. Members enjoy seeing the old 50+ year old photos of students & teachers. One lady announced on the private FB page that I was breaking the law by posting photos of people without their permission. That I had no right to do so. I told her the yearbooks were sold to the public, so there was no expectation of privacy, plus I was taking the photos with my camera from the printed pages. (Many of the students are already deceased.) What is the law?
The main issue is that you may have violated copyright law by posting the pictures. The photographer would normally hold the copyright in the photos, so even if the yearbooks were sold and made publicly available, you can't copy the photos (including taking pictures of the pictures). It is possible that as part of the yearbook arrangement, copyright was instead assigned to the individual student (unlikely) or some school-related organization such as "Class of 1969". Permission of the subject is not required; permission of the copyright holder would be.