convert parseInt to Math.floor; better image resize/pan