Refactor working S3 image upload from CKEditor