Refactor makeImages