Fix bug 886488: Add random sort for gallery page.