showing 3d only when image is 3d and show 3d is on

(not working entirely, see note in the code)