Changes for SS3.1 RC2 compatabilty

These changes are required to make the module compatable with ss3.1 RC2. managesRelations() can't be found on GalleryUploadField so I just copied it from UploadField. Maybe there's a better way to call it. The field templates also contain a new hidden input for managing relations on unsaved DataObjects, as well as a differnt loop.