refactored draw image