implemented date sort

- Also fixed the problem where images got their id without a dot.