Fix support for setCacheImage() to enforce refresh of a layer