Have you tried passing limit argument to imagesCollection? Not sure why the differences between playground result and your actual query though.