improve image drawing performance