In other sources they might use the signed version of m, where negative m indicates a flipped image. The formula here would have h_i be negative if it's upside down, and add a negative to z_i/z_o. There are also sets of rules around which side is positive for which quantity which can be found in most physics textbooks, which might be helpful if you're doing more involved calculations or multiple lenses systems.
In other sources they might use the signed version of m, where negative m indicates a flipped image. The formula here would have h_i be negative if it's upside down, and add a negative to z_i/z_o. There are also sets of rules around which side is positive for which quantity which can be found in most physics textbooks, which might be helpful if you're doing more involved calculations or multiple lenses systems.