PHP issues with code to display an image using a custom field

I have a site which had custom fields plugin. The plugin needed to upgrade the database. Before the upgrade the website was all messed up and when I upgraded the db it all started working except an image gallery on the homepage. It’s wanting to pull some images from a custom field on it, but it’s not working.

Looking at the source code, the img scr is showing a number instead of the actual image URL.

I am not sure if the code that I’m using is outdated though since the images are not coming up since it’s giving it a bad/wrong source url and I’m not sure how to fix this. Do you know how could this be fixed?