switch to using an imageChooser function, and fix indentation