init sidebar before images are loaded (if supported)

The sidebar is currently initialized after all images are loaded, which can lead to an temporary absence of the sidebar if some images are loading slowly from an external server (like badges).
This patch initializes the sidebar directly after the DOM is loaded.