Added error exception for invalid media upload