Added sync in creating sdimage.