Description
The icon & preview upload code is extremely old and does a bunch of filesystem operations that are dangerous (renaming and removing files) using python os directly.
For safety and consistency, it should use storage classes instead - using a storage class instantiated with TMP_PATH so that it cannot access files outside of this directory (upload_image() does use storage already but it uses the default storage that starts from STORAGE_ROOT so it doesn't offer that kind of protection).
Affected functions:
devhub.views.upload_image()
addons.tasks.resize_preview()
addons.tasks.resize_icon()
Acceptance Criteria
┆Issue is synchronized with this Jira Task