@steveck-chung 
Yes,we can remove done check here. Only else case is enough
   else
      resizedImg(imgNodes[done]);