The Photos Library is a package file that is usually located in the Pictures folder on the Mac's internal hard drive. It's usually named, cleverly, "Photoslibrary.photoslibrary" Sometimes people store that Library on an external drive to help make more space available on their internal drive.
When you say that you "switched drives to an SSD" what do you mean? Did someone remove the original hard drive inside your iMac and replace it with a new SSD? Or did you replace an external hard drive?
Where was your Time Machine backup? This is usually on an external drive that's plugged into your computer. It is important that the Photos Library not be stored on the same drive as the Time Machine backup.
Let us know about this stuff, and we may be able to help...