#315 Replace database pattern storage with caching
#288 Move thumbnails into separate file area