"Graceful degradation" is pretty important, and there is no way to even display Flash if a user doesn't have a player. Whereas, it is at least possible to do fancy things with AJAX that can be dumbed-down for clients that do not support JavaScript.
I've never used Flash extensively so I'm not sure of the exact pros and cons of each, but as a user, I will go out of my way to avoid sites that use Flash. Javascript can display photos just fine, and doesn't slow down my entire computer.