Added some error checking to migxResourceMediaPath

This is part of a fix for problems identified in https://github.com/Bruno17/MIGX/issues/71