There is no problem using the klein theme. But conflict is creating only this particular task. I have test several way to made this code work for you. But When I had pasted this code in Twenty fifteen this is working as usual and I see gallery image is below the product. Did you check this? If not please check yourself and see the result.