Now that RESTBase returns the original image with each page summary endpoint request, we should make use of it to construct thumbnails on the client with the dimensions we need. Originally, RESTBase would only return images up to 300px wide, which considering device DPI would be hidden because of [[ https://github.com/wikimedia/mediawiki-extensions-Popups/blob/mpga/resources/ext.popups/renderer.js#L346 | some logic]] in Page Previews.
[[https://en.wikipedia.org/api/rest_v1/page/summary/Barack_Obama | Here]] is the new format from RESTBase:
```lang=json
{
"title": "Barack Obama",
"extract": "Barack Hussein Obama II (US /bəˈrɑːk huːˈseɪn oʊˈbɑːmə/ bə-RAHK hoo-SAYN oh-BAH-mə; born August 4, 1961) is an American politician who served as the 44th President of the United States from 2009 to 2017. He was the first African American to serve as president, as well as the first born outside the contiguous United States. He previously served in the U.S. Senate representing Illinois from 2005 to 2008, and in the Illinois State Senate from 1997 to 2004.\nObama was born in Honolulu, Hawaii, two years after the territory was admitted to the Union as the 50th state. He grew up mostly in Hawaii, but also spent one year of his childhood in Washington State and four years in Indonesia.",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/President_Barack_Obama.jpg/256px-President_Barack_Obama.jpg",
"width": 256,
"height": 320,
"original": "http://upload.wikimedia.org/wikipedia/commons/8/8d/President_Barack_Obama.jpg"
},
"originalimage": {
"source": "https://upload.wikimedia.org/wikipedia/commons/8/8d/President_Barack_Obama.jpg",
"width": 2687,
"height": 3356
},
"lang": "en",
"dir": "ltr",
"timestamp": "2017-01-31T08:42:35Z",
"description": "44th President of the United States of America"
}
```
Notice the new `originalimage` object. We should use this to construct thumbnails of [[ https://github.com/wikimedia/mediawiki-extensions-Popups/blob/mpga/resources/ext.popups/gateway.js#L6 | width used in the existing MediaWiki API end point]].