Metadata in loops
get_post_meta() function works In and Outside of the loop and you saying that you do see it working on a single image “but doesn’t in loop” means that you probably did not add the code to the right loop. To be clear It works with all posts types.