A crooked photo is not a problem
Nobody photographs a tray perfectly square and at the same distance every time. That is why the tray carries reference markers: from them the system reconstructs the real geometry, corrects the tilt and derives the scale in millimetres. The count does not depend on how you held the phone, but on what is actually on the tray.