Fixed isImage logic