Loading speed optimization.

- Reorder pre-loads in order of usage.
- Ensure the main image is loaded/queued first (even before the thumbnails).
- Queue thumbnails around the current image first.
- Get rid of "measure". Set the gallery to display:block immediately,
  but keep it hidden using visibility:hidden.
- Avoid browser re-layouts while resizing thumbnails.
  Set elist to display:none in the onLayoutChanged function.
- Show the gallery as soon as the layout/setup is complete. This gives the
  impression of a more responsive site, even though images will lag behind.
- Center the current thumbnail immediately on startup.