Fixed small bugs from last commit.
Fixed issue with recombining skeleton arrays into original image.