What is the most flexible photo gallery plugin available on WordPress?

By flexible, I mean a plugin that can:

* create galleries per folder / event
* display / generate thumbnails per size I want (it would be good to have an API/function for this)
* display the most recent gallery from either certain event or all photos uploaded.

Is there any? Or something close to this?