Many fixes on upload and deleting images