Use ArrayBuffer instead of object array as LUTs,

Also use only positive indexes. This results in 6-10x speedups.
Add ability to add already downloaded images to the image cache.