updated regex for thumbnail generation