Hi, francesca,
You can try opening iMovie while holding down the Option and Command keys and selecting to delete preferences in the box that appears. iMovie will open in a new library. Reopen your old library to get back to your projects. Now see if your photos share out properly.
If deleting preferences doesn't help, sometimes reducing the resolution of the photo itself helps. Try moving one of the photos to your desktop and opening it in the Preview app on your Mac. When in Preview, click on Tools/Adjust Size. Then, in the box that appears, lower the long resolution number to a number less than 4000, say 2500. So if the resolution is 4200 x 3200, change the 4200 number to 2500. Then import it back into a newly created project and export it. See if that cures the problem.
Another thing you can try is to do an Edit/Select All, Edit/Copy, of the media in your project and paste it into a newly created project. See if you can share out without grainy photos.
-- Rich