UDK Rorschach Shader

This is a shader that I am currently working on inside UDK. I want to created an effect similar to the mask that rorschach wears in the movie Watchmen.
The shader uses a sprite sheet that I generate inside Autodesk Maya with an other shader setup. The goal with the project is to store the sprite images
in the RGBA channels of the texture and the read the sprite sheet from them. Example, say that the sprite sheet consists of 256 images on a 2048×2048 texture,
thats 128px per image. In order to gain a higher resolution per image I want to store 64 images of the sprite sheet in each one of the texture channels.
This is the part I am currently working on, to get the shader to switching to another channel when it reaches the last image in the current channel.
This way I can get a higher resolution per image and still have 256 image sprite sheet but store images in different channels.
Right now the shader can only read a whole sprite sheet.