Mipmap generation for mgcb

Add basic support for mipmap generation and also removes color bug in texture resizing.
Could this line be split over two lines please.  The body of an if statement should always be on the next line.