void AddScreenshot(string imageKey, Bitmap bmp)
{
var index = thumbNailList.Images.Count;
thumbNailList.Images.Add(imageKey, CreateThumbnail(bmp));
if (thumbNailView.Items.ContainsKey(imageKey))
{
thumbNailView.Items[imageKey].ImageIndex = index;
}
else
{
thumbNailView.Items.Add(imageKey, imageKey, index);
}
templates[imageKey] = BitmapConverter.ToIplImage(bmp);
templateBMPs[imageKey] = bmp;
}