Fix several bugs in implementation

- CPU calculations did not stop after image was rendered.
- Several stack variables no longer used removed.
- Code to initialize this unused variables removed.
- Previously program never reached the condition at which an image was saved to disk. Fixed.