Random sprite generator in Java