fix #7877 - caption handling of images