Changes logic of retrieving share metadata

Fixes bug 1258505

Change-Id: Ia190150ea861e0696845ac65cea8ada1d94d5239