some extensions and improvements for thumbs gallery