made bitmap handler portable