Use the lens formula:
\[
\frac{1}{f}=\frac{1}{v}-\frac{1}{u}
\]
For the first position:
\[
f=20\text{ cm},\qquad u=-30\text{ cm}
\]
So,
\[
\frac{1}{20}=\frac{1}{v}-\left(-\frac{1}{30}\right)
\]
\[
\frac{1}{20}=\frac{1}{v}+\frac{1}{30}
\]
\[
\frac{1}{v}=\frac{1}{20}-\frac{1}{30}=\frac{1}{60}
\]
\[
v=60\text{ cm}
\]
Now the object is moved 5 cm towards the lens, so new object distance is:
\[
u'=-25\text{ cm}
\]
Again using lens formula:
\[
\frac{1}{20}=\frac{1}{v'}-\left(-\frac{1}{25}\right)
\]
\[
\frac{1}{20}=\frac{1}{v'}+\frac{1}{25}
\]
\[
\frac{1}{v'}=\frac{1}{20}-\frac{1}{25}=\frac{1}{100}
\]
\[
v'=100\text{ cm}
\]
Therefore, image shift is:
\[
100-60=40\text{ cm}
\]
Hence, the correct answer is:
\[
\boxed{(B)\ 40\text{ cm}}
\]