I/O error uploading image
I/O error uploading image

Fixed two errors when upload an image from a file.
One is the file name doesn't exist error.
Another is file got closed in a new thread since Django 1.7.

Change-Id: Ia64c385d89e0d938b14182f2744251f76b892eac
Closes-Bug: #1451429
(cherry picked from commit 810ad30607fff86fdb8c9b78fe0ac32d09259b78)

izadorozhna/dashboard_integration_tests,NCI-Cloud/horizon,VaneCloud/horizon,VaneCloud/horizon,NCI-Cloud/horizon,VaneCloud/horizon,Daniex/horizon,wangxiangyu/horizon,Daniex/horizon,NCI-Cloud/horizon,NCI-Cloud/horizon,wangxiangyu/horizon,izadorozhna/dashboard_integration_tests,wangxiangyu/horizon,Daniex/horizon,VaneCloud/horizon,wangxiangyu/horizon,Daniex/horizon