Repair your library when it has problems
If you experience problems with photos in a library, Photos can try to repair it. If problems persist, you can also restore your library from a Time Machine backup.
Important: You should back up your photo library before repairing your library.
If Photos is open, choose Photos > Quit Photos.
Press Option-Command and double-click the Photos icon in the Applications folder (or click the Photos icon in the Dock).
The Repair Library window opens.
Click Repair to rebuild your photo library.
For information about restoring photos from your iCloud Photo Library, see Recover deleted items.