fix failing wget statements under -o errexit in vmdk upload routine

Fix the case when uploaded image has no descriptor.
Refactored the code a bit

Tested:
1. monithic Sparse
2. monolithic flat
    2.1 flat file name mentioned in descriptor file
    2.1 flat file name not mentioned in descriptor file
3. descriptor header not found in the file
    3.1 image file name is *-flat, download descriptor
    3.2 image file name does not end with *-flat
4. file name contains all image properties

Change-Id: I0df9be5c2a1b9ed53cdb22d5cd40b94e56c48f37
Closes-bug: #1289664
Merge "fix failing wget statements under -o errexit in vmdk upload routine"