fix issue for different size images