I've created my images using scripts: @wimage = Sprite.new, @wimage.bitmap = Cache.picture("blank"), etc. I tried changing the z positions of the viewports in Spriteset_Battle but doesn't work either.
RESOLVED: I manage to find out what the problem was. Silly me. I had another script that was also modifying the z position. Simply removed it and perfect.