If your iPhoto Library gets damaged beyond repair, or you can't update it to Apple Photos, you may simply chose to extract the photos directly.
You can rebuild the iPhoto database, but before you do so, take a look inside the iPhoto Library folder.
To open the iPhoto Library with Finder, select it and pick "Show Package Contents" from the gear menu.
You can copy photos out from here, but don't delete anything if you wish to be able to rebuild the library and keep your comments, tags and arrangements in albums.
Each image can be in many albums and slide shows, but the image is not copied as much as you could fear. In the screen shot to the right, I have opened the "date" named folders to reveal the 3 versions of the same photo taken August 7 2005. The "Thumb" called 984.jpg is 248 by 180 pixels, and this is what iPhoto show when its view is set to a medium size. Because I have cropped and rotated the photo, the original has been moved to its own folder, and the edited image is now where the original was before the rotation and crop.
You can also get an even faster overview of what iPhoto (older versions than about 2010) has in its database by dragging the Thumb64.data or the Thumb32.data onto File juicer. It will make one or more TIFF files with a mosaic of all the icons.
If you extract all images from iPhot with File Juicer, File Jucier will recover all there is. This includes previews and thumbnails. Therefore you will likely end with several versions of the same images, and this can be tedious to sort out afterwards. Duplicate removal tools like Tidy Up! are best to detect exact duplicates. It is not so good for finding duplicates of the same image in different sizes. Therefore if you want to pull out images From your iPhoto Library with File Juicer, drop in the Masters (named "Masters" in iPhoto '09 and newer) folder if you only wish to recover those. Or use Finders search function for images do the same task.
The ithmb files on the iPod are larger, and largest contain the same images you find in the iPhoto iPod cache. They can be extracted by File Juicer too. The smaller ithmb files contain the same images in sizes: 176 x 220 pixels, 130 x 88, and 41 x 30 pixels.
When you have looked after your images in the places above, you know what you have, and you can try to
rebuild your iPhoto database. You do this by holding down the command and alt keys while you start
iPhoto.
This may take hours depending on the options you choose, as iPhoto possibly has a lot of work to do.