private static bool isImage(string fileName) { string ext = Path.GetExtension(fileName).ToLower(); if (ext == "") return false; return (imageFilter.IndexOf(ext) != -1 && File.Exists(fileName)); }