better bitmap handling