Strange change of page on success function


I’ve page ( of user profile where is possible upload and see photo uploaded.
When the photo are displayed if you click i’s possible to delete calling “delPhoto” function:

$scope.delPhoto = function(IDphoto,name) {
	${template: 'Elimino la foto...', duration:500});
	$''+name, {ID_PHOTO:IDphoto, nome:name}).success(function(){viewPicture}).error(function(){alert("Foto non eliminata!")});
	return false

function viewPicture() {
	${template: 'Sto cercando le tue foto...'});
    $ = null;
	getPhoto.getData(function(dataResponse) {
    $ = dataResponse;

All works great (the img selected it’s deleted from the server) but on success function I would call viewPicture function (to refresh photo remaining on the server) but don’t work, and the page automatically changed on mainpage!
I try to add $state.go(“”) on success, but when execute the script go before on app.welcome page and then on! What wrong???