moved gallery manipulation to window.load event to wait for images to load