Started abstracting out preview creation in preparation for new preview/filmstrip replacement.

Migrated thumbnail generation code from filmstrip.js.

Fixed issue with promises.