The prohibition in Exodus 20:4-5 is not on the making of images, but on the worship of an image. The verses around it supports this understanding, they speak of giving adoration to God alone. Verse 3 speaks of having no other gods, “You shall have no other gods before me.”, while in verse 5 we read that God is a jealous God. God explains His jealousy in the worship or adoration of created beings, “you shall not bow down to them or serve them; for I the Lord your God am a jealous God”. In Exodus 32:8 we read that the calf was seen as being god and was given adoration. In Leviticus 19:14 we read that the prohibition is on the deification of an idol. Worship of an image is prohibited in Leviticus 26:1 and in Deuteronomy 5:8-9. It was more on the worship of an image that the Commandment was centered on, clearly seen in 2 Kings 17:12.
The reason why the verse includes "You shall not make for yourself a graven image” is that the ancient Jews were prone to idolatry, being in a polytheistic world. They were prone to imagining the unfathomable God through things that is visible, such as animals (seen by the making of the golden calf, Ex. 32:8) and humans (Psalm 135:15-17; Deuteronomy 4:28). Since they haven't seen God, they couldn't represent the Invisible God (Deuteronomy 4:15-16). This would change as the result of the Incarnation, when we have seen God who became man for us (John 1:1, 14; Philippians 2:6-8; Colossians 1:15; Hebrews 1:3).
However, it is incorrect to read the verse by those words. Reading it as a prohibition on images is wrong, it would create a contradiction. There are various verse where God orders the making of images and accepted images as offerings (Exodus 18:25-22; Numbers 21:4-9; 1 Samuel 4:4; 6:5; 11, 17-18; 1 Kings 6:23-36, 7:27-39; 2 Chronicles 3:5, 7, 3:10-14, 3:16, 4:2-5, 13, 15, 5:7-8). If we read Exodus 20:4-5 in the context of an absolute prohibition on images, it would suggest a contradicting God. Which would be impossible, “if we are faithless, he remains faithful— for he cannot deny himself.” (2 Timothy 2:13, RSVCE).
In short, the prohibition is on the making of images for the sole purpose of making it an object of adoration. Giving it the same treatment as being a god. The prohibition is on the worship and adoration of an image, not in the making of it.