If you want to create a texture from a byte array containing compressed image data, you might want to look into using UE4’s builtin ImageWrapper module, which has all the required logic to detect, decompress and decode a variety of image formats. I don’t want to toot my own horn too much, but it just so happens that I added an article to the wiki a few weeks ago which demonstrates how to do this:
You should take a look at the part that starts with “Detect the image type using the ImageWrapper module” and ends with “Create the texture and upload the uncompressed image data”. Instead of copying the customized CreateTexture function, you could also use the standard UTexture2D::CreateTransient function, if you don’t mind that the texture gets created inside the transient package.