More detail would be nice such as; exactly which model of the iMac, what version of OS X is it running, what version of iPhoto is it running and exactly what do you mean by 'it don't work'.
Sorry but unless you tell us a lot more information there is nothing anyone can do except suggest that you fix it
We need to knwo details - version of iPhoto and of the OS, what does not work, error messages,
basically at this time you have said my car won't run
It could be you have not started it to the engine is missing
We can not see you or your computer - you have to give us details