It is very annoying while you write code and when testing the result is always the same. Turning off / disabling cache is not available in the plugin settings (or maybe I have missed that point). But there is an easy option for developers. Just append ngg_force_update=1 to your blog’s url.
Example:
if your site’s address is www.example.com/something, then you should call the site with www.example.com/something?ngg_force_update=1
In my case it was an exception, that is why the caching happened, and after including ngg_force_update the stacktrace appeared.