updated to include thumbnail stuff