In C# You can check programmatically by passing folder name and image name or just image name if folder is fixed
string folderPath = "Images";
string fileName = "img1";
DirectoryInfo root = new DirectoryInfo(Server.MapPath("~/"+folderPath));
FileInfo[] listfiles = root.GetFiles(fileName+".*");
if (listfiles.Length > 0)
{
}
else
{
}