fixed delete so that it only deletes when the data is actually there.
merged develop into bug/417/delete-upload
Variable checks for delete in layers.js
Merge pull request #419 from ozone-development/bug/417/delete-upload

tested on local branch. merging