Fix picture functions and arrange files