fix nullable media fields

This PR fixes exception when trying to set nullable media field to null.