replace Timeout with delay
add global function getLoadedGalleries