Swaps round the if statements in cube_to_image to fix bug

corrects error in cube_to_image - previously the outputs were the wrong way round on the if statement such that giving a slice position would not work and the output would be the image from the sum over cubes. Now the image at slicepos will be given.