The best way to handle this would be a semi DAM type of system where you’d save information about the image in a table and then reference it.
A good way to do this is to create a plugin that listens for the OnFileManagerUpload (https://docs.modx.com/current/en/extending-modx/plugins/system-events/onfilemanagerupload) event. Then you’d check the file’s MIME type to see if its an image, then save information about the image to your table along with the file path.
This way images stay on the server and are referenced in your DB.