moved img reading function into BitMask class, and updated tests