Refactored code.

Added code for AND mask.
Header error with DIB headers.