fix previewer calculation

there was an import error that was always getting swallowed
Merge pull request #2442 from dimagi/previewer

fix previewer calculation