Added horizontal and vertical flip to the bitmap/image array conversion routines.