Refactoring
Fixed the bug caused by drawImage when slicing