Fixed BMP output for files with size other than 100x100