Added error handling for sprite sheet