first pass at image registration code