Since you are fecthing from database. You need to do the following
1. Insert the image that you want to display as Unknown Image in database.
2. Give it Skey some negative number say 'Unknown'
3. Change your query as follows
string connectionString = WebConfigurationManager.ConnectionStrings["conString"].ConnectionString;
SqlConnection con = new SqlConnection(connectionString);
string query = "if exists(select Avatar from pets Where Skey = @Skey)
query += " begin select Avatar from pets Where Skey = @Skey end"
query += " else begin select Avatar from pets Where Skey = 'Unknown' end"
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
cmd.Parameters.AddWithValue("@Skey", Request.QueryString["ID"]);
object ReturnImage = cmd.ExecuteScalar();
byte[] photo = (byte[])ReturnImage;
Response.BinaryWrite(photo);
con.Close();