Fix error handling in media fetch