Significant improvments/refactoring
Fix error when no value has been set
Return correct uploaded file name