fix permissions check to view private gallery