Upload images in an elegant way with this AngularJS directive