Here is the working code in Python (using cURL):
#!/usr/bin/python import pycurl c = pycurl.Curl() values = [ (\"key\", \"YOUR_API_KEY\"),
Try adding the content-type for the jpg into your multipart boundary.
See this uRL for examples (at the end)
http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2