If goodorbad= "good" Then
sourcebmp.Value = GridImg.Image
imagelist1.Add(sourcebmp.Value)
Else
sourcebmp.Value = GridImg.Image
gridbmp.New2(40,40) ' <---------
resizebmp.DrawImage(sourcebmp.Value,rectsrc.Value,rectdest.Value,False)
imagelist1.Add(gridbmp.Value)
End If