Resize image

+add resize image metod
+cleanup code