(I believe that the traditional scholars, too, won't disallow passport photos and likes on the basis of 'the principle of compulsion' in Fiqh. However, your question is general. So, the answer is accordingly general.)
The prohibition of drawing pictures mentioned in hadiths is specific for the images that contain elements of polytheism in them. This following is an excerpt from a long article but summarizes the core argument that supports this opinion:
...the 'sin' involved in making images, as mentioned
in some of the cited narratives is that the 'artist', in his own mind,
makes a creation in the likes of God's creation. Even though this
'sin' remains inexplicable in the case of ordinary images and imaging,
yet it becomes stunningly apparent in the making of images, which are
representative of polytheistic beliefs. An 'artist' or a 'sculptor',
who makes an image for worship, actually claims certain qualities for
these images. he claims that these images hear man's calls; he claims
that these images can help man in his hardships; he claims that these
images, if they are adequately pleased can be a source of great
blessings for their worshippers. All these qualities of hearing,
understanding, responding, and, in certain cases, helping are
qualities specific to intelligent living-beings. Independently
intelligent living-beings are the creation of God alone. Whoever
claims these qualities for an image, made by his own hands is, in
fact, claiming to have created a creation, which is in the absolute
likes of the God's own creation.