Image position calculator - refactoring