Then post your complete error message - ALL THE RED TEXT.
And post the results of this (what do you see):
hasLicenseForToolbox = license('test', 'image_toolbox');
message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')