fix addImageAsync  bad judgment of generate image for the first ImageFile.
Merge pull request #4994 from Dhilan007/develop_crash

fix issue#3611:addImageAsync  bad judgment of generate image for the first ImageFile.