extracted image-select plugin to avoid duplication of code