You have to generalize your entity with System.FileDocument or System.Images.
Hope my answer helps you. Reach me out for any queries.
i did something like this but i didnot get how can i implement image uploader widget to upload the image !! in the form to add student.
You can try this
Hope it help https://www.youtube.com/watch?v=uYJe0Dx0cpo&ab_channel=AcademiaMendixBrasil