Tidied up image-template drawing to be a little more efficient.