refactored image_uploader