Save preview visible in localStorage - needs a lot of refactoring