setting gallery URLs to gallery ids