C program, receives a BMP image and equalizes light intensity of image