get the resource id from the key, while fetching the media object