overhauling image handling - part 1