Implemented methods 1 and 2 using PIL for image loading.