Make this query (or similar):
http://localhost:8888/w/api.php?action=query&format=json&prop=pageimages&piprop=thumbnail&pithumbsize=150&pilimit=50&generator=listpages&glspid=70&glsplimit=50
When collection with id 150 is empty I get a [] in my response
When it's not I get
{"query":{"pages":{"6":{"pageid":6,"ns":0,"title":"Albert Einstein","thumbnail":{"source":"http://localhost:8888/w/images/thumb/3/3e/Einstein_1921_by_F_Schmutzer_-_restoration.jpg/91px-Einstein_1921_by_F_Schmutzer_-_restoration.jpg","width":91,"height":120}}}}}
Please be consistent and always return an array or an object.