Changed thumb extraction to be performed on init, not on request; added functionality so the gallery will be re-initialized every 5 seconds; removed some unncessary code;