restore original graphical settings after plotting jpg with zero margin

Original graphical settings are now saved prior to plotting the jpg image without no margin and restored afterwards so that no new graphical device needs to be opend to plot with axes again.