Refactors buildImage to use Promise; don't draw bad images