optimize image sync by introducing reference image version, cc @regilero