First draft of working code that should theoretically match smaller image to a big image