Now images are given cache headers. Fixes #4
Added protection for file overwriting.