Well, you need to know what format (GIF, JPEG, TIFF etc.) your photo is in. If you don't know, and only have an array of bytes, your task is impossible (well, maybe you can "sniff" the format by looking at the bytes, but that's dodgy).
If you do know the format, you can read the bytes into a
Java BufferedImage using ImageIO operations. When you have a BufferedImage, you can do things like AffineTransform on it, to change size, shape etc. Then you can write out to a different array of bytes, using ImageIO again.