Add save slice image function