refactor draw image