mesa: refactor: move pixel map/scale/bias code into image.c