Map preview generation

Fixes a thread synchronization problem with the sheetbuilder and the map preview generation. It was not apparent previously because of the 50ms delay. This also improves the speed of the preview generation.

See also: #5503 for an alternative.