Fixed image resizing issues