This looks right. To shorten it a bit, I guess you could use a for loop.
int min = -1;
int max = 1;
int average = 0;
int amount = 0;
for(int k = min; k <= max; k++){
for(int l = min; l <= max; l++){
amount++;
average += image1->image[i+k][j+l];
}
}
average /= amount;
image2->image[i][j] = average;
It still looks messy, but this way you can alter the smooth "radius" by changing the min and max variables.