Apply format in cache. Closes #48.

Woohoo! With this we have a fully functional image cache with resizing.

@oriolblanc I had to change the default value of scaleMode to `.None` or the unit tests failed. I kinda like that the default format is a no-op now (doesn't change the original image).
This looks like functional programming. Good job man!