auto setting of image mode (needs work)