Better error handling on media PUT request