Working version with image selection dialog