Optimized thumbnail creation
Added scaling factor for visual mode