Image drawing bugfixes