LPS-44263 Improve error messages when they refer to a file/image size

Hey Nate,

Although the pull may seem a little too long, we just want you to review the last 3 commits (as those are the one that affect the js, the rest are backend changes). If everything seems good please fwd it to Brian.

Thanks!