Refactor part 2 (images)