Fix wrong cropping bug when rendering partial DOM

Added a timeout of 0 prior to resolving promise so that the cloned
document is rendered correctly before promise resolves. Otherwise, the
output image had wrong cropping bounds.