Added unit tests, and fixed bug with not drawing an image