BMP images processing in C