Improve thumbnail preview with size detection