The previous point about checking the return value of malloc is absolutely correct. Much of programming is about handling error conditions properly.

What are the values in image[0]..image[4], and exactly what result in meanarray[0] are you expecting to see?
Have you tried checking the algorithm in a simple testbed, e.g.
Code:
main()
{
  int *image={2,4,8,1,9,16,3,47,6,13};
  int meanarray[8];
  for (int i=2; i<8; i++)
  {
    meanarray[i-2]=(image[i-2]+...[image[i+2])/5;
  }
}
(there may be errors in that; I just typed it straight in without testing).
I would expect meanarray[0] to contain 4, in this case (2+4+8+1+9=24; 24/5=4).