public void ProcessRequest(HttpContext context) { int imageid; Int32.TryParse(context.Request.QueryString["imageid"], out imageid); if ((context.Request.HttpMethod == "GET") && (imageid > 0)) { Picture currentPic = db.GetItemPicture(imageid); if (currentPic == null) { context.Response.StatusCode = 404; context.Response.End(); } context.Response.BinaryWrite(currentPic.image_data); context.Response.ContentType = "image/jpeg"; } else { context.Response.StatusCode = 404; } }