Use cache to serve up JPEG tiles.

Can we merge those changes? works as expected.