Keep the selection on the image file on double-click.

This fixes #5701.