resize image to fit container (jquery+angular)