Punchlist stuff, fixing some broken things

- Adds sorting by time created and last updated, and changes redirects to more intelligently use these sorting types.
- Fixes copying published badges with images, and using templates with images.
- Fixes the view page so that it displays images for drafts and templates.
- Fixes a crash when saving badges with no criteria (which shouldn't actually happen, but developer databases know no such rules)