Add image rendering code and remove test code