How can you replace the photos on your iMac?

If your Mac has crashed and you have lost all data then unless you made a backup of all the photos they cannot be replaced. If you used Time Machine and your iMac was connected to an external hard drive then all your photos are on that external hard drive. Simply open Time Machine and restore all the photos to iPhoto.