split off helper function for linear interpolation between images
(#618)