Improvements to preview mode, including better image scaling.