RAZ-2992: Uploading of images throws error
- Fixed code logic to pass proper vars and do proper checks