resizing image with angular and javascript