Pict2Cam is a fake camera app that you can use to pick images from your device and feed them to a camera request.
It also includes a cropper to ease image editing.
** DISCLAIMER **
* The app does not work for most social media apps, since they bundle their own camera app.
* The app does not work in Android 11 onwards since the OS limits which apps can handle camera requests to the system's default camera app.
You can find the source code of the app at https://github.com/adriangl/pict2cam