Little refactoring in toolkit image system