Added a mipmap algorithm that tries to find contrasting pixels.
Fixed tile packing bug.