This allows a const BITMAP_BASE to expose const image
data. This is currently done with const_casts, which is
"OK", only as long as the source image is not declared
const, in which case it's undefined behaviour.
Also immediately dereference the pointer to a reference
if it's not checked to make the non-null requirements
explicit at the point of access.