Merge "Prevent NPE issues when removing media" into tm-qpr-dev