Firstly why you are you using handler? you can do this directly
if (ds.Tables[0].Rows.Count > 0)
{
Image1.ImageUrl ="~/"+ ds.Tables[0].Rows[0]["CompanyLogo "].ToString();
}
By using handler
In page add company id in qyerystring
Image1.ImageUrl = "Handler1.ashx?Companyid="Convert.ToInt16(Session["CompanyID"].ToString());
In hander change you sql query as follows
public void ProcessRequest(HttpContext context)
{
string sql = @"select CompanyLogo from Companies where CompanyID=" + context.Request.QueryString["Companyid"].ToString();
SqlCommand command = new SqlCommand(sql, con);
SqlDataReader dReader = command.ExecuteReader();
dReader.Read();
context.Response.ContentType = "image/png";
context.Response.WriteFile("~/" + dReader["CompanyLogo"].ToString());
dReader.Close();
}