Refactor image upload directive by removing unnecessary code.