[3.7] Fix #1138 #1139 : Consecutive Image Tools calls may fail