Fixed null pointer exception on media creation