The PHPCR implementation does not persist the position as it is part of the galleryHasMedia collection of the Gallery document. Due to this the type cannot be guessed and will throw an error to define a type for the field.