You need to make the image width and height be the same first. Also, note that the alpha will be lost, you can fix that if need be by setting the alphadata of the second image to the alphadata of the first image.