Image: revert b451f6e0ff3a92481d9d0d0010475b9692ea098d and rewrite more cleanly