squashed a couple of bugs in image decoding
support for internal palettes
made the code a bit clearer
add license.md