im trying to display image in template but ive tried every method and it fails. I have a function that takes a user input image and search for the closest match in the datab