fix a bug with detecting thumbnails