Remove preview and thumbnail generation.
Code cleanup and template fixes.
Numerous bug fixes.