refactor to actually support 2 images