Refactor for better "images" code