refactored image sprite rendering