---
# System prepended metadata

title: 'Proposal: Image Schema Change'

---

# Proposal: Image Schema Change
## Problem
For scalability while adding personalization we have always added different wrapper keys around the main object. E.g. - 
```jsonld=
{
images: {
    desktop: [],
    mobile: []
}
}
```

in this case if we need a different image for android or ios we will do this - 
```jsonld=
{
images: {
    desktop: [],
    mobile: [],
    android: [],
    ios: []
}
}
```

## Suggestion
I propose we use the following format for all our images 
```jsonld=
{
    images: [
        {
            default:"",
            ios:"",
            android:"",
            desktop:""
        }
    ]
}
```

and accompanying code : 


```typescript=
// Calling Code
const persKey = req.device.model 
|| req.device.brand; // whatever is required

const image = doc.getImage(persKey);


// Fetch Code
getImage(personalizationKey:string): string {
    return productSchema.images[personalizationKey]
    || productSchema.images.default;
}
```

### Pros 
1. Ease in personalization

### Cons
1. Number of images need to be same accross devices (I think this can be solved by using `null`)