Honor shortened thumbnail paths in mw.Title.newFromImg()

Currently mw.Title.newFromImg() fails when the thumbnail path is
shortened.

Cf.
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/1e0bd351b760c2b1d9f5c0e058dc1c3bf9a83d2e/includes%2Ffilerepo%2FFileRepo.php#L1623

Change-Id: I7c166cfaefc1c31f9c378edd98c46f61b9c30aa3
Merge "Honor shortened thumbnail paths in mw.Title.newFromImg()"