Added code to sync gallery