Call this function just before saving the image
public bool ValidateFileDimensions()
{
using (System.Drawing.Image myImage = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream))
{
return (myImage.Height == height && myImage.Width == width);
}
}