Added method to resize images