Thanks for your post.
If you're using the online service, you can get your photo taken at one of the booths that are located (among other places) in many larger supermarkets. (I used one in Morrisons).
As long as it says that it provides digital passport photos (as they all seem to nowadays anyway), your photos will have a code printed with them. See the illustration here:
https://www.photo-me.co.uk/activity/digital-passport-photo/
When you use the online service, you won't then have to bother about uploading (or posting) a photo. You simply enter that code into the relevant field on the form and your photo is found electronically from the records of the company that owns the photo booth.
Modern photo booths also have technology that automatically checks that your photo will meet the requirements of the Passport Agency too. It makes everything a lot simpler than it used to be!