fixed image thumbnail not found bug
modularizing code