The relation between twins and optical domains in YBa2Cu3O7-Gd