Add event handler to enable clearing the cache.

Why it's necessary to sometimes clear the cache:

When you dynamically refresh a part of your page (i.e. via Ajax) that contains images, and you then want to use imagesLoaded to determine whether these images have finished loading, it will wrongly tell you that they are loaded because it finds them in the cache.

It's therefore necessary to have a way of clearing the cache if one wants to refresh sections of your page containing images (via Ajax).

My proposed fix works, but is perhaps not the most elegant way of achieving this, so I'm open to suggestions on how to best do this.