Why images come first
Images are usually the largest resource type on a content page by total bytes, and they are also the easiest to fix — reducing an image's dimensions carries no functional risk, unlike removing a script.
They also compound. A page with twenty images that are each three times larger than necessary is carrying an enormous amount of waste, and a single pass of resize-and-compress removes most of it without anyone touching the code.