fix public preview creation if a user is logged in

Fixes broken preview creation for public link shares if you are logged in with a different user while opening the public link.

@PVince81 @kabum can you have a look at it? Thanks!