I don't think it's a blocker for merging, but this solution seems to be very sensitive to bandwidth for instance. It could not work on slow connection. Maybe better solution would be to for instance check if uniqueLayoutId is the same 3 or 5 times in a row and then stop? Or if it's really just about images then keep doing it till all the images get loaded.