Updated logic of sprite initialization in Object.