using System.Drawing;
Stream inputStream = httpContext.Request.Files[0].InputStream;
using(Image img = Image.FromStream(inputStream))
{
if( img.Width < 640 && img.Height < 480)
{
throw new Exception("your error message");
}
}