Fixed bugs. Added original image undo option.