Refactored mga_bmp_load_from_file function.