Changes to fix image sharing cherry picked from devel