Method for reducing memory fragmentation for a computer device lacking a graphics memory management unit, said method being implemented in said computer device, wherein said method is characterized in that it comprises the steps of: • for each image in a source set of images determining image size in pixels and obtaining a minimal total number of pixels for an aggregated surface by obtaining a sum of image sizes; • factorizing said sum of image sizes into a surface's width and height wherein when it is determined that said sum of image sizes cannot be factorized due to being a prime number or factorization exceeding hardware constraints, incrementing said total number of pixels until the width and height factors are found; • allocating memory for said surface; • creating a mapping between an image identifier and its location, width, height for each image associated with the surface; • for each image casting, according to its offset in the surface, the two-dimensional space of the image to one dimension according to the formula: ∘ pi = yi * width + xi + location ∘ where i >=0 and i < size of the image ∘ where ▪ xi, yi is a location of image's pixels in the two-dimensional space; ▪ pi is position in image's one-dimensional space; ▪ the location defines an offset of the image in the surface's one-dimensional space; • knowing the casting formula between said one and two-dimensional spaces, copying each image to the surface thereby reducing fragmentation within said surface. • for each image in a source set of images determining image size in pixels and obtaining a minimal total number of pixels for an aggregated surface by obtaining a sum of image sizes; • factorizing said sum of image sizes into a surface's width and height wherein when it is determined that said sum of image sizes cannot be factorized due to being a prime number or factorization exceeding hardware constraints, incrementing said total number of pixels until the width and height factors are found; • allocating memory for said surface; • creating a mapping between an image identifier and its location, width, height for each image associated with the surface; • for each image casting, according to its offset in the surface, the two-dimensional space of the image to one dimension according to the formula: ∘ pi = yi * width + xi + location ∘ where i >=0 and i < size of the image ∘ where ▪ xi, yi is a location of image's pixels in the two-dimensional space; ▪ pi is position in image's one-dimensional space; ▪ the location defines an offset of the image in the surface's one-dimensional space; ∘ pi = yi * width + xi + location ∘ where i >=0 and i < size of the image ∘ where ▪ xi, yi is a location of image's pixels in the two-dimensional space; ▪ pi is position in image's one-dimensional space; ▪ the location defines an offset of the image in the surface's one-dimensional space; ▪ xi, yi is a location of image's pixels in the two-dimensional space; ▪ pi is position in image's one-dimensional space; ▪ the location defines an offset of the image in the surface's one-dimensional space; • knowing the casting formula between said one and two-dimensional spaces, copying each image to the surface thereby reducing fragmentation within said surface.