Solved by ptrblck in post #2 
              
              
                Did you make sure all image tensors have the same width and height after removing the two mentioned transformations? 
Also, is this effect reproducible, i.e. how many times did you run the code?