moo2 image handling code