Init $scope.images before using.
Refactor usage of $http