When my sketch saves an image to the phone's SD card it saves the file correctly, but the image doesn't appear in the gallery and shows up black when opened in MyFiles. This seems to be happening because the Android's MediaScanner isn't run after the sketch saves the image. I say this because connecting it to the PC, or even simply copying the image file on the phone causes the media scanner to run which fixes everything and makes the files display correctly.
I found a post about how to force the media cache to update:
Unfortunately I don't know how to do this in Processing. I'm also unsure which permission they are referring to in that post, I don't see it in the list in Processing.