added image scaling and fixed some browser bugs