When performing a search on the database I'm getting this error.

I'm running Python 3.8 and had to update the packages to get them to compile. I had to use 3.8 because I'm running on a Macbook Pro M1 and anything lower will not compile. When I use this version of python I have to install the latest version of scikit-image or it won't compile when trying to install the package via pip.
These are the package versions that I have
elasticsearch==8.0.0
scikit-image==0.19.2
six==1.15.0
flask==2.0.3
In order to fix this issue I had to change the following lines of code.

When I search for the exact image that is in the path it does not return accurate results.
Any guidance would be greatly appreciated! Thank you.