You can use the System.DirectoryInfo.GetFiles method to find the file:
string param = GetParamFromQueryString();
string relativeWebServerPathToFolder = "../images/imgAnimal";
var dirInfo = new DirectoryInfo(Server.MapPath(relativeWebServerPathToFolder));
var foundFiles = dirInfo.GetFiles(param + ".jpg"); // you can also use + ".*" to search for all files
if (foundFiles.Length == 1)
{
ClientScript.RegisterStartupScript(this.GetType(), "openFoundImage", "window.open('" + relativeWebServerPathToFolder + foundFiles.Name + "');", true); // registers a script block to pop open the file
}
Docs for ClientScript.RegisterStartupScript: http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx