Factor out resizing code
Make resizing category work with different options and

make the cache take a block as an image filter. This replaces
the should resize and the resize properties from the cache. The filter
should take care of all of these.