initialize pending tasks count in image class