Time Based change of image

I believe you’re using the wrong function. get_the_time() doesn’t actually return the current time but instead the time of when the post was published. Maybe what you’re looking to use is date( 'H' ).