Removed redundant code

Removed redundant code.
Added experimental save canvas to image function.