image drawing memory/decoding optimizations. closes #40